<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
   
    <script>
        //普通函数
        // const obj ={
        //     name:'张三',
        //     age: 18,
        //     getName(){
        //         console.log(this.name)
        //     }
        // }
        //箭头函数 三无 无this（找父元素）， 无arguments ,不能new操作
        // const obj2 = {
        //     name :'zhangsan ',
        //     age:18,
        //     getName: () => {
        //         console.log(this.name)
        //     }
        // }
        const user = {
            name:'zhangsan',
            address:{
                city:'shenz',
                area:'cun',
            }
        }
        console.log(user?.address?.area)
    </script>
</body>
</html>